<template>
  <div>
    <div v-show="list.length" class="container">
      <div class="list-control">
        <h3 class="cjthfy-top">
          <div>精彩旅行故事</div>
        </h3>

        <!-- <div class="list-control-filter">
          <span>颜色：</span>
        </div>-->
      </div>
      <four v-for="item in filteredAndOrderedList" :info="item" :key="item.id"></four>
    </div>
  </div>
</template>




<script>
import four from "../components/four.vue";
export default {
  components: { four },
  computed: {
    list() {
      return this.$store.state.productList;
    },
    brands() {
      return this.$store.getters.brands;
    },
    colors() {
      return this.$store.getters.colors;
    },

    filteredAndOrderedList() {
      let list = [...this.list];
      if (this.filterBrand == "景点") {
        list = list.filter(item => item.brand === this.filterBrand);
        return list;
      }
    }
  },
  data() {
    return {
      filterBrand: "景点",
      filterColor: "",
      order: ""
    };
  },
  methods: {
    handleFilterColor(color) {
      if (this.filterColor === color) {
        this.filterColor = "";
      } else {
        this.filterColor = color;
      }
    }
  },
  mounted() {
    this.$store.dispatch("getproductList");
  }
};
</script>

<style>
.cjthfy-top {
  font-weight: 800 !important;
  margin-bottom: 0px !important;
  font-size: 24px !important;
  line-height: 30px !important;
  letter-spacing: normal !important;
  text-transform: undefined !important;
  color: #484848 !important;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
  margin-top: 20px;
}
.cjthfy-bott {
  font-size: 16px !important;
  line-height: 22px !important;
  letter-spacing: normal !important;
  text-transform: undefined !important;
  color: #484848 !important;
  padding-top: undefined !important;
  padding-bottom: undefined !important;
  font-weight: normal !important;
  margin-top: 0px !important;
  /* margin-bottom: 31px; */
}
.list-control {
  background: #fff;
  border-radius: 6px;
  margin: 16px;
  width: 1078px;
  overflow: hidden;
}
.list-control-filter {
  width: 1078px;
  overflow: hidden;
  margin: 16px 0px;
}
.list-control-filter-item {
  min-width: 120px;
  height: 48px;
  padding: 14px 16px;
  border-radius: 3px;
  background: rgb(255, 255, 255);
  box-sizing: border-box;
  box-shadow: rgba(0, 0, 0, 0.15) 0px 1px 2px;
  font-size: 17px;
  color: rgb(72, 72, 72);
  text-align: center;
  font-weight: bold;
  line-height: 20px;
  outline: none;
  border: 0.5px solid rgb(216, 216, 216);
  transition: box-shadow 0.5s ease 0s;
  line-height: 42px;
}
.list-control-filter-item,
.list-control-order-item {
  cursor: pointer;
  display: inline-block;
  border: 1px solid #e9eaec;
  border-radius: 4px;
  margin-right: 16px;
  padding: 2px 6px;
}
.list-control-filter-item.on,
.list-control-order-item.on {
  background: rgb(0, 132, 138);
  border: 1px solid rgb(0, 132, 138);
  color: #fff;
}
.four-not-found {
  text-align: center;
  padding: 32px;
}
</style>